using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class City1Map : EntityTypeConfiguration<City1>
    {
        public City1Map()
        {
            // Primary Key
            this.HasKey(t => t.ID);

            // Properties
            this.Property(t => t.Name)
                .HasMaxLength(30);

            this.Property(t => t.Symbol)
                .HasMaxLength(10);

            // Table & Column Mappings
            this.ToTable("City");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.Name).HasColumnName("Name");
            this.Property(t => t.Symbol).HasColumnName("Symbol");
            this.Property(t => t.CITY_Mouhafaza).HasColumnName("CITY_Mouhafaza");
            this.Property(t => t.CITY_Kadaa).HasColumnName("CITY_Kadaa");
        }
    }
}
